AC_INIT([Holt],1.0,[manyac+holt@gmail.com], holt)
AC_CONFIG_SRCDIR(src/holt.c)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

AC_PREREQ(2.60)

AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
                [enable debugging])], debug=$enableval, debug=no)

if test x$CFLAGS = x; then
  CFLAGS="-Wall -Wextra"

  if test x$debug = xyes; then
    CFLAGS="-ggdb ${CFLAGS}"
  else
    CFLAGS="-O4 ${CFLAGS}"
  fi
fi

if test x$debug = xyes; then
  CFLAGS="${CFLAGS} -DHAVE_DEBUG"
fi

CFLAGS="${CFLAGS} $(pkg-config --cflags freetype2)"
LDFLAGS="${LDFLAGS} $(pkg-config --libs freetype2)"

AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL

AC_SEARCH_LIBS([pthread_create],[pthread],,AC_MSG_ERROR([pthread library unavail
able]))


AC_OUTPUT([Makefile src/Makefile tests/Makefile libholt.pc])
